package com.itheima.blackitheima;

import java.util.ArrayList;

//自定义泛型方法
public class MyGenericityTest2 {
    public static void main(String[] args) {
        ArrayList<String> list1 = addElement(new ArrayList<String>(), "a", "b", "c", "d");
        System.out.println(list1);

        ArrayList<Integer> list2 = addElement(new ArrayList<Integer>(), 1, 2, 3, 4);
        System.out.println(list2);


    }
    public static<T> ArrayList<T> addElement(ArrayList<T> array,T t1,T t2,T t3,T t4){
        array.add(t1);
        array.add(t2);
        array.add(t3);
        array.add(t4);
        return array;

    }
}
